package gang.org.springframework.boot.web.embedded.tomcat;

import gang.org.springframework.boot.web.servlet.GangServletContextInitializer;

import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import java.util.Set;

/**
 * @Author：gang.chen
 * @Date：2023/10/12 8:59
 */
public class GangTomcatStarter implements ServletContainerInitializer {

    public final GangServletContextInitializer[] initializers;

    public GangTomcatStarter(GangServletContextInitializer[] initializers) {
        this.initializers = initializers;
    }

    @Override
    public void onStartup(Set<Class<?>> classes, ServletContext servletContext) throws ServletException {

        for (GangServletContextInitializer initializer : this.initializers) {
            initializer.onStartup(servletContext);
        }
    }
}
